{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cd075767-a06c-4a0e-8a6f-2f9808001b34",
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "请输入非负整数m： 3\n",
      "请输入非负整数n： 3\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "整数1 = 3, 整数2 = 3\n",
      "最大公约数 = 3, 最小公倍数 = 3\n"
     ]
    }
   ],
   "source": [
    "import random\n",
    "m1=int(input(\"请输入非负整数m：\"))\n",
    "n1 = int(input(\"请输入非负整数n：\"))\n",
    "print(str.format(\"整数1 = {0}, 整数2 = {1}\", m1, n1))\n",
    "if (m1 > n1):\n",
    "    m = m1; n = n1\n",
    "else:\n",
    "    m = n1; n = m1\n",
    "r=1\n",
    "while (r != 0):\n",
    "    r = m % n;m = n;n = r\n",
    "print(str.format(\"最大公约数 = {0}, 最小公倍数 = {1:1.0f}\", m, m1 * n1 / m))\n",
    "input()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0072bed9-3b61-4256-94e7-bd5a99d47756",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
